package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcGrade;
import com.visizen.wisdomclass.server.model.WcGradeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcGradeMapper {
    @SelectProvider(type=WcGradeSqlProvider.class, method="countByExample")
    int countByExample(WcGradeExample example);

    @DeleteProvider(type=WcGradeSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcGradeExample example);

    @Delete({
        "delete from wc_grade",
        "where GRADE_ID = #{GRADE_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long GRADE_ID);

    @Insert({
        "insert into wc_grade (GRADE_ID, GROUP_ID, ",
        "GRADE_NAME, DESCRIPTION)",
        "values (#{GRADE_ID,jdbcType=BIGINT}, #{GROUP_ID,jdbcType=BIGINT}, ",
        "#{GRADE_NAME,jdbcType=VARCHAR}, #{DESCRIPTION,jdbcType=VARCHAR})"
    })
    int insert(WcGrade record);

    @InsertProvider(type=WcGradeSqlProvider.class, method="insertSelective")
    int insertSelective(WcGrade record);

    @SelectProvider(type=WcGradeSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="GRADE_ID", property="GRADE_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="GROUP_ID", property="GROUP_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="GRADE_NAME", property="GRADE_NAME", jdbcType=JdbcType.VARCHAR),
        @Result(column="DESCRIPTION", property="DESCRIPTION", jdbcType=JdbcType.VARCHAR)
    })
    List<WcGrade> selectByExample(WcGradeExample example);

    @Select({
        "select",
        "GRADE_ID, GROUP_ID, GRADE_NAME, DESCRIPTION",
        "from wc_grade",
        "where GRADE_ID = #{GRADE_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="GRADE_ID", property="GRADE_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="GROUP_ID", property="GROUP_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="GRADE_NAME", property="GRADE_NAME", jdbcType=JdbcType.VARCHAR),
        @Result(column="DESCRIPTION", property="DESCRIPTION", jdbcType=JdbcType.VARCHAR)
    })
    WcGrade selectByPrimaryKey(Long GRADE_ID);

    @UpdateProvider(type=WcGradeSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcGrade record, @Param("example") WcGradeExample example);

    @UpdateProvider(type=WcGradeSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcGrade record, @Param("example") WcGradeExample example);

    @UpdateProvider(type=WcGradeSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcGrade record);

    @Update({
        "update wc_grade",
        "set GROUP_ID = #{GROUP_ID,jdbcType=BIGINT},",
          "GRADE_NAME = #{GRADE_NAME,jdbcType=VARCHAR},",
          "DESCRIPTION = #{DESCRIPTION,jdbcType=VARCHAR}",
        "where GRADE_ID = #{GRADE_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcGrade record);
}